namespace SisGAC.Migrations
{
    using System;
    using System.Data.Entity.Migrations;
    
    public partial class ArtigoCompleto : DbMigration
    {
        public override void Up()
        {
            CreateTable(
                "dbo.Area",
                c => new
                    {
                        AreaId = c.Int(nullable: false, identity: true),
                        Nome = c.String(),
                    })
                .PrimaryKey(t => t.AreaId);
            
            AddColumn("dbo.Artigo", "NumeroAutores", c => c.Int(nullable: false));
            AddColumn("dbo.Artigo", "DataCriacao", c => c.DateTime(nullable: false));
            AddColumn("dbo.Artigo", "Situacao", c => c.String());
            AddColumn("dbo.Artigo", "Observacao", c => c.String());
            AddColumn("dbo.Artigo", "Resumo", c => c.String());
            AddColumn("dbo.Artigo", "Abstract", c => c.String());
            AddColumn("dbo.Artigo", "Arquivo", c => c.Binary());
            AddColumn("dbo.Artigo", "Area_AreaId", c => c.Int());
            AddForeignKey("dbo.Artigo", "Area_AreaId", "dbo.Area", "AreaId");
            CreateIndex("dbo.Artigo", "Area_AreaId");
        }
        
        public override void Down()
        {
            DropIndex("dbo.Artigo", new[] { "Area_AreaId" });
            DropForeignKey("dbo.Artigo", "Area_AreaId", "dbo.Area");
            DropColumn("dbo.Artigo", "Area_AreaId");
            DropColumn("dbo.Artigo", "Arquivo");
            DropColumn("dbo.Artigo", "Abstract");
            DropColumn("dbo.Artigo", "Resumo");
            DropColumn("dbo.Artigo", "Observacao");
            DropColumn("dbo.Artigo", "Situacao");
            DropColumn("dbo.Artigo", "DataCriacao");
            DropColumn("dbo.Artigo", "NumeroAutores");
            DropTable("dbo.Area");
        }
    }
}
